import Common from "@/utils/Common";

class IndexUtils extends Common {
    private static utils_: IndexUtils;

    // 私有构造函数
    private constructor() {
        super()
    }

    // 单列模式 获取实例
    public static get Instance(): IndexUtils {
        if (this.utils_ == null) {
            this.utils_ = new IndexUtils();
        }
        return this.utils_
    }

    // 字符串转dom
    public parseDom(arg: string): ChildNode {
        return super.parseDom(arg)
    }

    // 节流
    public debounced(func: Function, delay: number, immediate: boolean = false): Function {
        return super.debounced(func, delay, immediate)
    }
    // 防抖
    public throttle(func: Function, delay: number, immediate: boolean = false): Function {
        return super.throttle(func, delay, immediate)
    }
}

export default IndexUtils